Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue when calling Delete PIT endpoint and no PITs exist #11711

Merged
merged 3 commits into from
Jan 2, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jan 2, 2024

Description

When the DELETE PIT endpoint is called without any PITs in existence, its possible that an IllegalArgumentException (IllegalArgumentException: groupSize must be greater than 0 but was 0) is being swallowed and a malformed response ({"error":{") can be returned.

The opensearch logs contains the following error:

ERROR RestResponseListener:91 - failed to send failure response
java.lang.IllegalStateException: Channel is already closed
...
    Suppressed: java.lang.IllegalArgumentException: groupSize must be greater than 0 but was 0

When the DELETE PIT endpoint is called when no PITs exist, it tries to send multiple responses across the same REST channel. This PR fixes the behavior so that its no longer possible for channel.sendResponse to be called multiple times.

Related Issues

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link
Contributor

github-actions bot commented Jan 2, 2024

❌ Gradle check result for 82c92de: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Jan 2, 2024

❌ Gradle check result for c773bf0: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Jan 2, 2024

Compatibility status:

Checks if related components are compatible with change 6f87b99

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/performance-analyzer.git]

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link
Contributor

github-actions bot commented Jan 2, 2024

❕ Gradle check result for 6f87b99: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6a01d2f) 71.39% compared to head (6f87b99) 71.29%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11711      +/-   ##
============================================
- Coverage     71.39%   71.29%   -0.11%     
+ Complexity    59186    59171      -15     
============================================
  Files          4906     4906              
  Lines        278198   278199       +1     
  Branches      40422    40422              
============================================
- Hits         198624   198337     -287     
- Misses        63120    63414     +294     
+ Partials      16454    16448       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@peternied peternied merged commit c52d4a3 into opensearch-project:main Jan 2, 2024
33 checks passed
@peternied peternied added the backport 2.x Backport to 2.x branch label Jan 2, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 2, 2024
Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit c52d4a3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
peternied pushed a commit that referenced this pull request Jan 4, 2024
…#11713)

(cherry picked from commit c52d4a3)

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…rch-project#11711)

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants